<html class="popupwin">
<!--
/***************************************************************
*  Copyright notice
*
*  (c) 2004  Ki Master George <kimastergeorge@gmail.com>
*  (c) 2005-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*  A copy is found in the textfile GPL.txt and important notices to the license
*  from the author is found in LICENSE.txt distributed with these scripts.
*
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This script is a modified version of a script published under the htmlArea License.
*  A copy of the htmlArea License may be found in the textfile HTMLAREA_LICENSE.txt.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/*
 * Insert Smiley Plugin for TYPO3 htmlArea RTE
 *
 * TYPO3 SVN ID: $Id: insertsmiley.html 4102 2008-09-13 23:04:59Z stan $
 */
-->
<head>
	<title>Insert Smiley</title>
	<meta http-equiv="Content-Style-Type" content="text/css" />
	<script type="text/javascript">
		/*<![CDATA[*/
		<!--
		var dialog = window.opener.HTMLArea.Dialog.InsertSmiley;
		var param;

		function Init() {
			var totalsmileys = 20;
				// Do not resize until the smileys are inserted on the page
			dialog.initialize(false, "noResize", false);

			param = dialog.arguments;
			var tbody = document.getElementById("smileytable");
			var inum;
			var trow;
			for(var i = 1; i <= totalsmileys; i++) {
				if((i - 1) % 4 == 0) {
					trow = tbody.insertRow((i - 1) / 4);
				}
					// find new number to be found in smileys folder
				inum = "";
				if(i < 1000) {
					if(i < 100) {
						if(i < 10) {
							inum = "000" + i;
						} else {
							inum = "00" + i;
						}
					} else {
						inum = "0" + i;
					}
				} else {
					inum = i;
				}
				trow.insertCell((i - 1) % 4).innerHTML = "<a href=\"javascript:onOK('" + inum + "')\"><img style=\"border: 0px;\" alt=\"Smiley " + + i + "\" src=\""+ param.editor_url +"plugins/InsertSmiley/smileys/" + inum + ".gif\" />";
			}
			dialog.resize();
		};

		function onOK(smileynum) {
			var params = {};
			params.imgURL = param.editor_url +"plugins/InsertSmiley/smileys/" + smileynum + ".gif";
			dialog.performAction(params);
			dialog.close();
			return false;
		};

		function onCancel() {
			dialog.close();
			return false;
		};
		// -->
		/*]]>*/
	</script>
</head>
<body class="popupwin" onload="Init();">
<div id="content">
<div class="title">Insert Smiley</div>
<form action="" method="get">
	<div class="smileytable" style="text-align: center;">
		<table id="smileytable" name="smileytable"></table>
	</div>
	<div class="space"></div>
	<div class="buttons">
		<button type="button" onclick="return onCancel();">Cancel</button>
	</div>
	<br />
</form>
</div>
</body>
</html>
